<?php

class /* SINGLETON */ RenderedTableRegister {

	var $aRenderedTableArray = array();
	
	function RenderedTableRegister() {
		if ( !$this->_Toggle() ) {
			die( 'Call to public constructor against singleton: RendererdTableRegister' );
		}
	}
	
	function & GetInstance() {
		static $oInstance;
		if ( empty( $oInstance ) ) {
			RenderedTableRegister::_Toggle();
			$oInstance = new RenderedTableRegister();	
		}
		return $oInstance;
	}

	function _Toggle() {
		static $bSucceed = false;
		$bSucceed = !$bSucceed;
		return !$bSucceed;
	}
	
	function SetTableRendered( $sTableName ) {
		$this->aRenderedTableArray[] = $sTableName;
	}

	function WasTableRendered( $sTableName ) {
		return in_array( $sTableName, $this->aRenderedTableArray );
	}	
	
	
}

?>
